package com.kuang;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;

public class LoginServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        super.doPost(req, resp);
        String username=req.getParameter("username");
        String password=req.getParameter("password");
        String[] hobbies = req.getParameterValues("hobbies");
        System.out.println("用户名:" + username);
        System.out.println("密码:" + password);
        System.out.println("爱好："+ Arrays.toString(hobbies));


        req.getRequestDispatcher("/success.jsp").forward(req,resp);
    }
}
